<div class="container">
	<div class="tabbable tabs-left" id="admin_bar">
		<%= render 'shared/admin_bar'%>
		<div class="tab-content">
			<h1> <%= t 'sua_san_pham'%> </h1>
			<% if flash.now[:loi].present? %>
			<p class="alert alert-error">
				<%= flash.now[:loi]%>
			</p>
			<% end %>
			<%= form_tag request.url, :id=> 'sua_san_pham', :class=> "tao_html" do %>
			<p>
				<img src="<%= @san_pham.hinh_anh %>" class="hinh_anh_dai_dien img-rounded"/>
				<br >
				<h3><%= @san_pham.noi_dung("vi", true).tieu_de %> <small><a href="<%= url_for :action=> 'index', :controller=>"/san_pham", :danh_muc_slug => @san_pham.danh_muc.slug, :san_pham_slug => @san_pham.slug %>">(<%= t 'xem_san_pham'%>)</a></small></h3>
				<div>
					<span><%= t'cac_ngon_ngu_da_dich'%></span>
					<% for noi_dung in @san_pham.noi_dung_san_phams%>
					<span class="ten_ngon_ngu"><a href="<%= url_for :action=>"ban_dich", :uid => params[:uid], :ngon_ngu => noi_dung.ngon_ngu%>"><%= APP_CONFIG['ngon_ngu'][noi_dung.ngon_ngu]['ten']%></a></span>
					<% end %>
				</div>
				<%= label_tag :hinh_anh, t('file_hinh_anh_san_pham') %>
				<%= text_field_tag :hinh_anh, @san_pham.hinh_anh %>
				<br />
				<a href="<%= admin_anh_duoc_upload_path %>" class="btn btn-small" target="_blank"><%= t'cac_anh_da_upload'%></a>
				<a href="<%= admin_upload_path %>" class="btn btn-small" target="_blank"><%= t'upload_anh_moi'%></a>
			</p>
			<div class="input-append">
				<%= text_field_tag :gia, @san_pham.gia, :class=> "span2 text-right", :placeholder => t('gia_san_pham')%>
				<span class="add-on">VND</span>
			</div>
			<h3><%= t 'khuyen_mai'%></h3>
			<p>
				<% t 'nhap_gia_khuyen_mai_neu_co'%>
			</p>
			<div class="input-append">
				<%= text_field_tag :gia_khuyen_mai, @san_pham.gia_khuyen_mai, :class=> "span2 text-right", :placeholder => t('gia_khuyen_mai')%>
				<span class="add-on">VND</span>
			</div>
			<div>
				<span><%= t 'tu_ngay'%></span>
				<div class="input-append date datepicker" id="khuye_mai_bat_dau" data-date="<% Time.now.strftime('%d-%m-%Y') %>" data-date-format="dd-mm-yyyy">
					<%= text_field_tag :khuyen_mai_bat_dau, ((@san_pham.khuyen_mai_bat_dau.present? ? @san_pham.khuyen_mai_bat_dau.strftime('%d-%m-%Y') : nil)), :class=> "span2 text-right", :readonly => true%>
					<span class="add-on"><i class="icon-th"></i></span>
				</div>
				<span><%= t 'den_ngay'%></span>
				<div class="input-append date datepicker" id="khuye_mai_ket_thuc" data-date="<% Time.now.strftime('%d-%m-%Y') %>" data-date-format="dd-mm-yyyy">
					<%= text_field_tag :khuyen_mai_ket_thuc, ((@san_pham.khuyen_mai_ket_thuc.present? ? @san_pham.khuyen_mai_ket_thuc.strftime('%d-%m-%Y') : nil)), :class=> "span2 text-right", :readonly => true%>
					<span class="add-on"><i class="icon-th"></i></span>
				</div>
			</div>
			<p>
				<%= submit_tag t('sua_san_pham'), :class=>"btn btn-large btn-primary" %>
			</p>
			<% end %>
		</div>
	</div>
</div>
